import { createApp } from "vue";
import App from "@/App.vue";
import { mountAntDesign } from "@/plugins/AntDesign";
import router from "@/router/index.router";
import { mountComponent } from "@/components/components.ts";
import {createPinia} from "pinia";
import {mountConfig} from "@/vue.config.ts";

const store = createPinia();

async function bootstrap() {
    const app = createApp(App);
    // 挂载UI组件配置
    mountAntDesign(app);
    // 挂载组件
    mountComponent(app);
    // 挂载路由
    app.use(router);
    // 挂载状态管理
    app.use(store);
    // 挂载全局配置
    mountConfig(app);
    // 路由准备就绪后挂载 APP 实例
    // https://router.vuejs.org/api/interfaces/router.html#isready
    await router.isReady();
    app.mount('#app');
}


void bootstrap();
